A signal is an asynchronous notification of an event. A signal is said
to be generated for (or sent to) a process or a thread when the event
associated with that signal first occurs. Examples of such events
include hardware faults, timer expiration and terminal activity, as well
as the invocation of the _kkkk_iiii_llll_llll(2), _ssss_iiii_gggg_qqqq_uuuu_eeee_uuuu_eeee(3) or _ssss_iiii_gggg_ssss_eeee_nnnn_dddd(2) system calls.
In some circumstances, the same event generates signals for multiple
processes. A process may request a detailed notification of the source
of the signal and the reason why it was generated [see _ssss_iiii_gggg_iiii_nnnn_ffff_oooo(5)].
At the time of generation, the system will determine whether the signal
is directed at a process or a specific thread within that process.
Signals that are naturally associated with a particular thread, such as
hardware faults, are directed to the appropriate thread. This is usually
due to the signal being generated during the execution of the thread and,
moreover, in the context of executing that thread. Signals that are sent
to a process tend to be those that are generated asynchronously with
respect to the execution of the process. Signals generated by the _k_i_l_l
interface or sent as a result of a tty interrupt are examples of signals
directed at a process.
Each process may specify a system action to be taken in response to each
signal sent to it, called the signal's disposition. For multithreaded
processes, the disposition is shared by all threads in the process. The
set of system signal actions for a process is initialized from that of
its parent. Once an action is installed for a specific signal, it
usually remains installed until another disposition is explicitly
requested by a call to either _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2), _ssss_iiii_gggg_nnnn_aaaa_llll(2), _ssss_iiii_gggg_nnnn_aaaa_llll(3B),
_ssss_iiii_gggg_vvvv_eeee_cccc(3B) or _ssss_iiii_gggg_ssss_eeee_tttt(2), or until the process execs [see _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2) and
_ssss_iiii_gggg_nnnn_aaaa_llll(2)]. When a process execs, all signals whose disposition has been
set to catch the signal will be set to _SSSS_IIII_GGGG______DDDD_FFFF_LLLL. Alternatively, a process
may request that the system automatically reset the disposition of a
signal to _SSSS_IIII_GGGG______DDDD_FFFF_LLLL after it has been caught [see _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2) and
_ssss_iiii_gggg_nnnn_aaaa_llll(2)].
A signal is said to be delivered to a process or thread when the
appropriate action for the signal is taken. During the time between the
generation of a signal and its delivery, the signal is said to be pending
[see _ssss_iiii_gggg_pppp_eeee_nnnn_dddd_iiii_nnnn_gggg(2)]. Ordinarily, this interval cannot be detected by an
application. However, a signal can be blocked from delivery to a thread
[see _ssss_iiii_gggg_hhhh_oooo_llll_dddd(2), _ssss_iiii_gggg_bbbb_llll_oooo_cccc_kkkk(3) and _ssss_iiii_gggg_pppp_rrrr_oooo_cccc_mmmm_aaaa_ssss_kkkk(2)]. If the action
associated with a blocked signal is anything other than to ignore the
signal, and if that signal is generated for the process or thread, the
signal remains pending until either it is unblocked or the signal's
disposition requests that the signal be ignored. Signals generated for
the process shall be delivered to exactly one of the threads within the
process. The thread must either be executing the _s_i_g_w_a_i_t function
selecting that signal or it must not be blocking delivery of the signal.
If there are no threads in a call to a _s_i_g_w_a_i_t function selecting that
signal, and if all threads within the process block delivery of the
signal, the signal shall remain pending of the process until either a
thread calls a _s_i_g_w_a_i_t function selecting that signal, a thread unblocks
delivery of that signal, or the action associated with the signal is set
to ignore the signal. If the signal disposition of a blocked signal
requests that the signal be ignored, and if that signal is generated for
the process or thread, the signal is discarded immediately upon
generation.
On IRIX, a pending signal is usually delivered when a thread returns from
the kernel. This happens at the end of a system call or at the end of a
hardware interrupt. Since the scheduling clock interrupt occurs at a
regular 10 msec interval, this means that the latency between the
generation of a signal and its delivery can never be more than 10 msec.
For real-time application(defined as process with high band non-degrading
priority), a generation of a signal always force an immediate signal
delivery.
Each thread has a signal mask that defines the set of signals currently
blocked from delivery to it [see _ssss_iiii_gggg_pppp_rrrr_oooo_cccc_mmmm_aaaa_ssss_kkkk(2) or _pppp_tttt_hhhh_rrrr_eeee_aaaa_dddd______ssss_iiii_gggg_mmmm_aaaa_ssss_kkkk(3P)].
The signal mask for a thread is initialized from the thread that created
it.
The determination of which action is taken in response to a signal is
made at the time the signal is delivered, allowing for any changes since
the time of generation. This determination is independent of the means
by which the signal was originally generated.
The signals currently defined in _ssss_iiii_gggg_nnnn_aaaa_llll_...._hhhh are as follows:
IRIX supports all signal numbers between 0 and 64. All signals between 0
and 32 are currently used. POSIX 1003.1b reserves all signals between
_SSSS_IIII_GGGG_RRRR_TTTT_MMMM_IIII_NNNN and _SSSS_IIII_GGGG_RRRR_TTTT_MMMM_AAAA_XXXX for real-time applications. Even though the kernel
does not use any signals between 35 and 64, signal number between 35 and
49 are not guaranteed to be available to user programs in future
releases. Further more, the default behavior for signals between 35 and
49 is to exit.
No signals beyond 32 are applicable to the Berkeley signal functions
because these functions use a fixed 32 bits signal mask as part the
programming interface.
Higher priority signals are delivered first when multiple unblocked
signals are pending in order to prioritize event notifications. On the
other hand, a lower priority signal can not preempt a higher priority
signal handler.
All signals between 0 and 32 are of equal priority but all are at higher
priority than signals between _SSSS_IIII_GGGG_RRRR_TTTT_MMMM_IIII_NNNN and _SSSS_IIII_GGGG_RRRR_TTTT_MMMM_AAAA_XXXX. Within the range of
_SSSS_IIII_GGGG_RRRR_TTTT_MMMM_IIII_NNNN to _SSSS_IIII_GGGG_RRRR_TTTT_MMMM_AAAA_XXXX, the lower the signal number the higher the priority
of that signal.
Using the _ssss_iiii_gggg_nnnn_aaaa_llll(2), _ssss_iiii_gggg_nnnn_aaaa_llll(3B), _ssss_iiii_gggg_ssss_eeee_tttt(2), _ssss_iiii_gggg_vvvv_eeee_cccc(3B) or _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2)
system call, a process may specify one of three dispositions for a
signal: take the default action for the signal, ignore the signal, or
If execution of the signal handler interrupts a blocked system call, the
handler is executed and the interrupted system call returns a -1 to the
calling thread with _eeee_rrrr_rrrr_nnnn_oooo set to _EEEE_IIII_NNNN_TTTT_RRRR. However, if the _SSSS_AAAA______RRRR_EEEE_SSSS_TTTT_AAAA_RRRR_TTTT flag
is set the system call will be transparently restarted.
NNNNOOOOTTTTEEEESSSS
The dispositions of the _SSSS_IIII_GGGG_KKKK_IIII_LLLL_LLLL and _SSSS_IIII_GGGG_SSSS_TTTT_OOOO_PPPP signals cannot be altered
from their default values. The system generates an error if this is
attempted.
The _SSSS_IIII_GGGG_KKKK_IIII_LLLL_LLLL and _SSSS_IIII_GGGG_SSSS_TTTT_OOOO_PPPP signals cannot be blocked. The system silently
enforces this restriction.
Whenever a process receives a _SSSS_IIII_GGGG_SSSS_TTTT_OOOO_PPPP, _SSSS_IIII_GGGG_TTTT_SSSS_TTTT_PPPP, _SSSS_IIII_GGGG_TTTT_TTTT_IIII_NNNN, or _SSSS_IIII_GGGG_TTTT_TTTT_OOOO_UUUU
signal, regardless of its disposition, any pending _SSSS_IIII_GGGG_CCCC_OOOO_NNNN_TTTT signal are
discarded. Further more, the process will not act upon any delivered
signals other than _SSSS_IIII_GGGG_KKKK_IIII_LLLL_LLLL until a _SSSS_IIII_GGGG_CCCC_OOOO_NNNN_TTTT is received.
Whenever a process receives a _SSSS_IIII_GGGG_CCCC_OOOO_NNNN_TTTT signal, regardless of its
disposition, any pending _SSSS_IIII_GGGG_SSSS_TTTT_OOOO_PPPP, _SSSS_IIII_GGGG_TTTT_SSSS_TTTT_PPPP, _SSSS_IIII_GGGG_TTTT_TTTT_IIII_NNNN, and _SSSS_IIII_GGGG_TTTT_TTTT_OOOO_UUUU signals
is discarded. In addition, if the process was stopped, it is continued.
When a signal is delivered to a thread, if the action of that signal
specifies termination, stop, or continue, all the threads in the process
shall be terminated, stopped, or continued, respectively.
Processes which are blocked via a _b_l_o_c_k_p_r_o_c system call will unblock if
they receive a signal which is fatal (i.e., a non-job-control signal
which the are NOT catching), but will still be stopped if the job of
which they are a part is stopped. Only upon restart will they die. Any
non-fatal signals received by a blocked process will NOT cause the
process to be unblocked (an _u_n_b_l_o_c_k_p_r_o_c(2) or _u_n_b_l_o_c_k_p_r_o_c_a_l_l(2) system
call is necessary).
_SSSS_IIII_GGGG_PPPP_OOOO_LLLL_LLLL is issued when a file descriptor corresponding to a STREAMS [see
_iiii_nnnn_tttt_rrrr_oooo(2)] file has a ``selectable'' event pending. A process must
specifically request that this signal be sent using the _IIII______SSSS_EEEE_TTTT_SSSS_IIII_GGGG _iiii_oooo_cccc_tttt_llll
call. Otherwise, the process will never receive _SSSS_IIII_GGGG_PPPP_OOOO_LLLL_LLLL.
If the disposition of the _SSSS_IIII_GGGG_CCCC_HHHH_LLLL_DDDD signal has been set with _ssss_iiii_gggg_nnnn_aaaa_llll, _ssss_iiii_gggg_vvvv_eeee_cccc
or _ssss_iiii_gggg_ssss_eeee_tttt, or with _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn and the _SSSS_AAAA______NNNN_OOOO_CCCC_LLLL_DDDD_SSSS_TTTT_OOOO_PPPP flag has been
specified, it will only be sent to the calling process when its children
exit; otherwise, it will also be sent when the calling process's children
are stopped or continued due to job control.
The name _SSSS_IIII_GGGG_CCCC_LLLL_DDDD is also defined in this header file and identifies the
same signal as _SSSS_IIII_GGGG_CCCC_HHHH_LLLL_DDDD. _SSSS_IIII_GGGG_CCCC_LLLL_DDDD is provided for backward compatibility,
new applications should use _SSSS_IIII_GGGG_CCCC_HHHH_LLLL_DDDD.
The disposition of signals that are inherited as _SSSS_IIII_GGGG______IIII_GGGG_NNNN should not be
changed.
A call to _s_i_g_n_a_l cancels a pending signal _s_i_g except for a pending
_SSSS_IIII_GGGG_KKKK_IIII_LLLL_LLLL signal.
A call to _s_i_g_s_e_t with a signal handler other than _SSSS_IIII_GGGG______IIII_GGGG_NNNN will
automatically allow pending signals for the set signal to come in.